package red.mlz.consoleconsumer.feign.game;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import red.mlz.common.entity.game.Game;

import java.util.List;

@FeignClient(name = "game-service" , contextId = "game")
public interface GameFeign {

    @RequestMapping("/game-service/games")
    List<Game> getGames(@RequestParam(name = "page")Integer page,
                               @RequestParam(name = "pageSize") Integer pageSize,
                               @RequestParam(name = "keyword", required = false)String keyword);

    @RequestMapping("/game-service/gettotalgames")
    Integer getTotalGames();

    @RequestMapping("/game-service/game/{id}")
    Game getGameById(@PathVariable("id") Long id);

    @RequestMapping("/game-service/game/edit")
    Long editGame(@RequestParam(name = "gameId", required = false) Long gameId,
                         @RequestParam(name = "gameName") String gameName,
                         @RequestParam(name = "playerNumber") Long playerNumber,
                         @RequestParam(name = "title") String title,
                         @RequestParam(name = "coverImages") String coverImages,
                         @RequestParam(name = "releaseDate") String releaseDate,
                         @RequestParam(name = "price") Float price,
                         @RequestParam(name = "categoryId") Long categoryId,
                         @RequestParam(name = "gameDescription") String gameDescription,
                         @RequestParam(name = "rating") Float rating,
                         @RequestParam(name = "tags",required = false)String tags);

    @RequestMapping("/game-service/game/deleted")
    Long delete (@RequestParam(name = "gameId")Long gameId);
}
